#include <linux/module.h>

#include <linux/init.h>
#include <linux/fs.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/sched.h>
#include <linux/pm.h>
#include <linux/slab.h>
#include <linux/sysctl.h>
#include <linux/proc_fs.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/input.h>
#include <linux/gpio_keys.h>
#include <linux/workqueue.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/of_gpio.h>
#include <linux/of_irq.h>
#include <linux/spinlock.h>

/* alloc set register platform_driver */
static struct input_dev *g_input_dev;

static const struct file_operations input_handlers_fileops = {
	.owner		= THIS_MODULE,
	.open		= input_proc_handlers_open,
	.read		= seq_read,
	.llseek		= seq_lseek,
	.release	= seq_release,
};

static int input_dev_demo_probe(struct platform_device *pdev)
{
    struct device *dev = &pdev->dev;
    /* get hardware info from device tree */
    /*alloc set register*/
    g_input_dev = devm_input_allocate_device(dev);

    g_input_dev->name = "input_dev_demo";
	g_input_dev->phys = "input_dev_demo";
	g_input_dev->dev.parent = dev;

    /* set 1 : whitch event type?*/
    __set_bit(EV_KEY, input->evbit);
    __set_bit(EV_ABS, input->evbit);
    /* hardware operation */
    request_irq();
    return 0;
}

static int input_dev_demo_remove(struct platform_device *pdev)
{

}
static const struct of_device_id input_dev_demo_of_match[] = {
	{ .compatible = "me, input_dev_demo" },
	{}
};

static struct platform_driver input_dev_demo_driver = {
	.driver = {
		.name = "input_dev_demo",
		.of_match_table = input_dev_demo_of_match,
	},
	.probe = input_dev_demo_probe,
	.remove = input_dev_demo_remove,
};

static int __init input_dev_demo_init(void)
{
	return platform_driver_register(&input_dev_demo_driver);
}
module_init(input_dev_demo_init);

static void __exit input_dev_demo_exit(void)
{
	platform_driver_unregister(&input_dev_demo_driver);
}
module_exit(input_dev_demo_exit);

MODULE_AUTHOR("me");
MODULE_DESCRIPTION("Input framework");
MODULE_LICENSE("GPL");
